﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link type="text/css" rel="stylesheet" media="all" href="../styles/global.css"/>
    <link type="text/css" rel="stylesheet" media="all" href="../styles/global_color.css"/>
</head>
<body>
<!--Logo区域开始-->
<div id="header">
    <img src="../images/logo.png" alt="logo" class="left"/>
    <a href="/logout">[退出]</a>
</div>
<!--Logo区域结束-->
<!--导航区域开始-->
<div id="navi">
    <ul id="menu">
        <li><a href="/index" class="index_on"></a></li>
        <li id="lia1"><a href="/role_list" class="role_off"></a></li>
        <li id="lia2"><a href="/admin_list" class="admin_off"></a></li>
        <li id="lia3"><a href="/fee_list" class="fee_off"></a></li>
        <li id="lia4"><a href="/account_list" class="account_off"></a></li>
        <li id="lia5"><a href="/service_list" class="service_off"></a></li>
        <li id="lia6"><a href="/bill_list" class="bill_off"></a></li>
        <li id="lia7"><a href="/report_list" class="report_off"></a></li>
        <li><a href="/userInfo" class="information_off"></a></li>
        <li><a href="/userModifyPwd" class="password_off"></a></li>
    </ul>
</div>
<!--导航区域结束-->
<!--主要区域开始-->
<div id="main">
    <form action="" method="" class="main_form">
        <div class="text_info clearfix"><span>资费ID：</span></div>
        <div class="input_info"><input type="text" id="costId" class="readonly" readonly value="1"/></div>
        <div class="text_info clearfix"><span>资费名称：</span></div>
        <div class="input_info"><input type="text" id="name" class="readonly" readonly value="包 20 小时"/></div>
        <div class="text_info clearfix"><span>资费状态：</span></div>
        <div class="input_info">
            <select class="readonly" disabled id="selector">
                <option value="1">启用</option>
                <option value="0">暂停</option>
                <option value="2">删除</option>
            </select>
        </div>
        <div class="text_info clearfix"><span>资费类型：</span></div>
        <div class="input_info fee_type">
            <input type="radio" name="radFeeType" id="monthly" disabled="disabled" value="包月"/>
            <label for="monthly">包月</label>
            <input type="radio" name="radFeeType" id="package" disabled="disabled" value="套餐"/>
            <label for="package">套餐</label>
            <input type="radio" name="radFeeType" checked="checked" id="timeBased" disabled="disabled" value="计时"/>
            <label for="timeBased">计时</label>
        </div>
        <div class="text_info clearfix"><span>基本时长：</span></div>
        <div class="input_info">
            <input type="text" class="readonly" id="baseTime" readonly value="20"/>
            <span>小时</span>
        </div>
        <div class="text_info clearfix"><span>基本费用：</span></div>
        <div class="input_info">
            <input type="text" class="readonly" id="baseCost" readonly value="24.5"/>
            <span>元</span>
        </div>
        <div class="text_info clearfix"><span>单位费用：</span></div>
        <div class="input_info">
            <input type="text" class="readonly" id="dan" readonly value="3.00"/>
            <span>元/小时</span>
        </div>
        <div class="text_info clearfix"><span>创建时间：</span></div>
        <div class="input_info"><input type="text" class="readonly" id="create" readonly value="2013/1/1 00:00:00"/></div>
        <div class="text_info clearfix"><span>启动时间：</span></div>
        <div class="input_info"><input type="text" class="readonly" id="qidong" readonly value="2013/1/1 00:00:00"/></div>
        <div class="text_info clearfix"><span>资费说明：</span></div>
        <div class="input_info_high">
            <textarea class="width300 height70 readonly" id="desc" readonly>包 20 小时，20 小时以内 24.5 元，超出部分 3.00 元/小时</textarea>
        </div>
        <div class="button_info clearfix">
            <input type="button" value="返回" class="btn_save" onclick="location.href='fee_list.html';"/>
        </div>
    </form>
</div>
<!--主要区域结束-->
<div id="footer">
    <span>[源自北美的技术，最优秀的师资，最真实的企业环境，最适用的实战项目]</span>
    <br/>
    <span>版权所有(C)云科技有限公司 </span>
</div>
</body>
<script src="/js/jquery-3.2.1.js"></script>
<script>

    urlinfo = window.location.href; //获取当前页面的url
    len = urlinfo.length;//获取url的长度
    offset = urlinfo.indexOf("?");//设置参数字符串开始的位置
    parmarinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
    params = parmarinfo.split("=");//对获得的参数字符串按照“=”进行分割
    id = params[1];//得到参数值


    show();
    showData();
    function show() {

        $.ajax({
            url: "/selectAllModules",
            type: "post",
            success: function (result) {

                if (result.indexOf("角色管理") == -1) {
                    document.getElementById("lia1").style.display = "none"
                }
                if (result.indexOf("管理员") == -1) {
                    document.getElementById("lia2").style.display = "none"
                }
                if (result.indexOf("资费管理") == -1) {
                    document.getElementById("lia3").style.display = "none"
                }
                if (result.indexOf("账务账号") == -1) {
                    document.getElementById("lia4").style.display = "none"
                }
                if (result.indexOf("业务账号") == -1) {
                    document.getElementById("lia5").style.display = "none"
                }
                if (result.indexOf("账单管理") == -1) {
                    document.getElementById("lia6").style.display = "none"
                }
                if (result.indexOf("报表") == -1) {
                    document.getElementById("lia7").style.display = "none"
                }


            }

        });
    }
    function showData() {
        $.ajax({
            url: "/selectCostById",
            type: "post",
            data: {
                costId: id
            },
            success: function (result) {
                $("#costId").val(result.costId);
                $("#name").val(result.name);
                $("#selector").val(result.status);
                $("#baseTime").val(result.baseDuration);
                $("#baseCost").val(result.baseCost);
                $("#dan").val(result.unitCost);
                $("#create").val(result.creatime);
                $("#qidong").val(result.startime);
                $("#desc").val(result.descr);
                if (result.costType == '包月'){
                    $("#monthly").attr("checked", true)
                }
                if (result.costType == '套餐'){
                    $("#package").attr("checked", true)
                }
                if (result.costType == '计时'){
                    $("#timeBased").attr("checked", true)
                }
            }
        });
    }
</script>
</html>
